package cn.com.oidreams.wechat.robot.entity;

import cn.com.oidreams.common.annotations.Required;
import cn.com.oidreams.wechat.robot.enums.WeXinTalkEnum;
import lombok.Data;

/***
 ** @category 图片类型消息
 ** @author qing.yunhui
 ** @email: qingyh@glodon.com
 ** @createTime: 2021-12-14 20:09
 **/
@Data
public class ImageMsgRequest extends BaseRequest{

    public ImageMsgRequest(Image image) {
        setMsgtype(WeXinTalkEnum.MSG_TYPE.IMAGE.getCode());
        this.image = image;
    }
    @Required(errorMsg = "图片内容必填",classParse = true)
    private Image image;
    @Data
    public static class Image {
        public Image(String base64, String md5) {
            this.base64 = base64;
            this.md5 = md5;
        }
        @Required(errorMsg = "图片内容的base64编码必填",remark = "图片内容的base64编码")
        private String base64;
        @Required(errorMsg = "图片内容（base64编码前）的md5值必填",remark = "图片内容（base64编码前）的md5值")
        private String md5;
    }
}
